The present exemplary embodiments are directed to methods for image segmentation to produce a mixed raster content (“MRC”) image with multiple extracted constant color areas (“MECCA”). MRC modeling is a powerful image representation concept in achieving high compression ratios while maintaining high constructed image quality. MECCA modeling has the further advantages of relatively undemanding reconstruction requirements and inherent text enhancement and noise reduction features. The MECCA model contains one background layer, N foreground layers, and N mask layers where N is a non-negative integer. While the background layer can be a contone bitmap, the foreground layers are restricted to constant colors. U.S. Ser. No. 10/866,850 entitled “Method for Image Segmentation to Identify Regions with Constant Foreground Color”, filed Jun. 14, 2003 hereby incorporated by reference in its entirety, details a relevant MECCA modeling method.
The segmenting of the data into either background or foreground text is important because different compression algorithms are much more efficient for different kinds of images. For example, JPEG or other lossy compression algorithms are more efficient compression for pictures while other algorithms (CCITT G4 or LZW) are especially designed for binary images like text. Using different compression algorithms for different portions of the scanned image data provides the advantage of a high compression ratio for the data with high quality image reconstruction.
To generate MRC/MECCA representation for an image, segmentation is required. The segmentation algorithm generally consists of four steps, namely object extraction, object selection, color clustering, and result generation. In the first step, text and other objects are extracted from the image. Next, the objects are tested for color constancy and other features to decide if they should be represented in the foreground layers. The objects that are chosen are then clustered in color space as the third step. The image is finally segmented such that each foreground layer codes the objects from the same color cluster.
When the object candidates for foreground layers are first extracted, the clustering is performed to determine how many foreground layers are needed and how each object should be represented therein. There are currently two kinds of color clustering approaches for object representation: pixel based and object based. In the pixel based approach, clustering analysis is performed on pixel colors. As the objects are usually very noisy, the neighboring pixels within one object may often be grouped into different clusters and represented in different foreground layers. This results in very low coding efficiency. The object based approach is currently more prevalent and the clustering is performed on objects instead of pixels. This ensures grouping consistency within an object. Consequently, much higher coding efficiency can be achieved. However, the object based approach requires the object to be constant (at least visually) in color. A color uniformity check is thus required before the clustering.
The remaining parts of the image that cannot be coded in the foreground layers, including the regions of non-uniform colors and the page background, are coded in the background layers. If the background layer has to be coded for an entire page, the background layer coding will likely be undesirably inefficient as it may contain significant redundancy. First, the areas of the image that are defined by the foregrounds do not carry any background coding information. Second, white is the normal default color for a background, hence a white page background does not need to be coded.
In practice, when a page is scanned, a scanning window may not exactly match the precise page border. If the scanning window is slightly larger, a small portion of the scanner cover may appear in the scanned image. Conventionally, these areas are called “page borders”. The colors of the page borders depend on the scanner cover. Keeping in mind that a page border may only be a portion of the entire perimeter of the scanned page. If the color in the page border area varies, it may be segmented as a contone window and compressed in JPEG.
Although the page border is usually narrow and occupies only a very small area of the overall page, to code it in a straightforward manner may require a disproportionatelly large amount of bits. This is because JPEG codes rectangular areas. To cover a non-rectangular area, the entire area that is specified by its bounding box needs to be coded. For page border areas, the bounding box could be much larger. Quite often, it may extend to almost an entire page.
Accordingly, there is a need for a processing method and system which avoids present inefficient processing techniques of page borders in a background layer.